import request from '@/utils/request'

// 查询合同列表
export function contractlist(query) {
  return request({
    url: '/system/contract/list',
    method: 'get',
    params: query
  })
}

// 查询合同详细
export function getContract(postId) {
  return request({
    url: '/system/contract/' + postId,
    method: 'get'
  })
}

// 新增合同
export function addContract(data) {
  return request({
    url: '/system/contract',
    method: 'post',
    data: data
  })
}

// 修改合同
export function updateContract(data) {
  return request({
    url: '/system/contract',
    method: 'put',
    data: data
  })
}

// 删除合同
export function delContract(postId) {
  return request({
    url: '/system/contract/' + postId,
    method: 'delete'
  })
}


// 查询发票列表
export function invoicelist(query) {
  return request({
    url: '/system/invoice/list',
    method: 'get',
    params: query
  })
}

// 查询发票详细
export function getInvoice(postId) {
  return request({
    url: '/system/invoice/' + postId,
    method: 'get'
  })
}

// 新增发票程
export function addInvoice(data) {
  return request({
    url: '/system/invoice',
    method: 'post',
    data: data
  })
}

// 修改发票
export function updateInvoice(data) {
  return request({
    url: '/system/invoice',
    method: 'put',
    data: data
  })
}

// 删除发票
export function delInvoice(postId) {
  return request({
    url: '/system/invoice/' + postId,
    method: 'delete'
  })
}
